#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	int time = 0;
	int history = 0;
	scanf("%d %d", &time, &history);

	int hour = time / 100;
	int minute = time % 100;

	int add = (minute + history) / 60;
	minute = (minute + history) % 60;
	hour = (add + hour) % 24;

	printf("%d%02d", hour, minute);

	return 0;
}
